home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINWORDS / HTMTL050.ZIP / RTF2HTML.C < prev    next >
C/C++ Source or Header  |  1994-03-07  |  985b  |  43 lines

  1. /* rtf2html.c */
  2.  
  3. #include    <stdio.h>
  4. #include    <malloc.h>
  5. #include    <io.h>
  6.  
  7. #include    "rtftohtm.h"
  8.  
  9.  
  10. /**************************************/
  11.  
  12. main(int argc, char* argv[]){
  13.     char    arg[256];
  14.     char*   ofile;
  15.     int     rc = 0;
  16.     char*   buf;
  17.     unsigned    bl = 20000;
  18.     
  19.     if (argc==1){
  20.         buf = malloc(bl);
  21.         // no arguments: ask user the input filename.
  22.         puts("Give an input filename");
  23.         rc = RTFtoHTM(gets(arg),0,buf,bl);
  24.         puts(buf);
  25.     }    
  26.     if (argc>2){
  27.         _wsetexit(_WINEXITNOPERSIST);
  28.         // both arguments: do the conversion from file to file.
  29.         rc = RTFtoHTM(argv[1],0,argv[2],0);
  30.         ofile = argv[2];
  31.     }    
  32.     else{
  33.         buf = malloc(bl);
  34.         // one argument: do the conversion from file to buffer.
  35.         // puts the buffer to the screen.
  36.         rc = RTFtoHTM(argv[1],0,buf,bl);
  37.         puts(buf);
  38.     }
  39.     
  40.             
  41.     return 0;
  42. }
  43.